package com.example.myapplication.baidumap;

import androidx.appcompat.app.AppCompatActivity;

import android.app.Activity;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Message;
import android.util.Log;
import android.view.View;

import com.baidu.mapapi.bikenavi.BikeNavigateHelper;
import com.baidu.mapapi.model.LatLng;
import com.baidu.mapapi.walknavi.WalkNavigateHelper;
import com.baidu.mapapi.walknavi.adapter.IWEngineInitListener;
import com.baidu.mapapi.walknavi.adapter.IWRouteGuidanceListener;
import com.baidu.mapapi.walknavi.adapter.IWRoutePlanListener;
import com.baidu.mapapi.walknavi.model.RouteGuideKind;
import com.baidu.mapapi.walknavi.model.WalkRoutePlanError;
import com.baidu.mapapi.walknavi.params.WalkNaviLaunchParam;
import com.example.myapplication.R;

public class WNaviGuideActivity extends Activity {

    private BikeNavigateHelper bmNaviHelper;
    private WalkNavigateHelper wmNaviHelper;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //获取WalkNavigateHelper实例
        bikeinit();
    }
    public void walkinit(){
        wmNaviHelper = WalkNavigateHelper.getInstance();
        //获取诱导页面地图展示View
        View view = wmNaviHelper.onCreate(WNaviGuideActivity.this);
        if (view != null) {
            setContentView(view);
        }
        wmNaviHelper.startWalkNavi(WNaviGuideActivity.this);
    }
    public void bikeinit(){
        bmNaviHelper = BikeNavigateHelper.getInstance();
        //获取诱导页面地图展示View
        View view = bmNaviHelper.onCreate(WNaviGuideActivity.this);
        if (view != null) {
            setContentView(view);
        }
        bmNaviHelper.startBikeNavi(WNaviGuideActivity.this);
    }
    @Override
    protected void onResume() {
        super.onResume();
        bmNaviHelper.resume();
    }

    @Override
    protected void onPause() {
        super.onPause();
        bmNaviHelper.pause();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        bmNaviHelper.quit();
    }

}